import java.util.Arrays;
import java.util.Scanner;

public class 归并排序 {
    static int[] arr;
    static int[] tmp ;
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        arr = new int[n];
        tmp = new int[n];
        for (int i = 0; i < n; i++) arr[i] = s.nextInt();
        merge_sort(0,n-1);

        System.out.println(Arrays.toString(arr));
    }
    private static void merge_sort(int l,int r) {
        if(l>=r) return;
        int mid = (l+r)/2;
        merge_sort(l,mid); merge_sort(mid+1,r);
        int p=l;
        int q=mid+1;
        int k=0;
        while(p<=mid && q<=r) {
            if(arr[p]<=arr[q]) tmp[k++]=arr[p++];
            else tmp[k++]=arr[q++];
        }
        while(p<=mid) tmp[k++]=arr[p++];
        while (q<=r) tmp[k++]=arr[q++];
        for (int i = l, j = 0; i <= r; i ++ , j ++ ) arr[i] = tmp[j];

    }

}
